<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>web excel test</title>
</head>
<body>
    <button id="btn">移除</button>
    <button id="btn1">改变行数</button>
    <button id="btn2">改变列数</button>
    <button id="btn3">获取数据</button>
    <button id="btn4">填充数据</button>
    <button id="btn5">选择单元格</button>
    <button id="btn6">初始化表格</button>


    <div id="daodao" style="width:1000px;height:600px;"></div>
    <script src="./daodaoExcel.js"></script>
    <script>
        var exc = new DaoDaoExcel({id:'daodao'})
        document.getElementById('btn').addEventListener('click',() => {
            exc.dispose()
        })
        document.getElementById('btn1').addEventListener('click',() => {
            exc.setRowNum(10)
        })
        document.getElementById('btn2').addEventListener('click',() => {
            exc.setSpanNum(10)
        })
        document.getElementById('btn3').addEventListener('click',() => {
            let data = exc.getTableDatas()
            console.log(data)
        })
        document.getElementById('btn4').addEventListener('click',() => {
            let data = [
                [{x:1,y:1,text:'123',lbIcon:"rightArrow",ltIcon:"leftArrow",rtIcon:"upArrow",rbIcon:"filter",cellWidth:300},{x:1,y:2,text:'12354848',cellHeight:100}],
                [{x:35,y:40,text:'123aaa'},{x:6,y:8,text:'1235484aaaf8'}]
            ]
            exc.setTableDatas(data,true)
        })
        document.getElementById('btn5').addEventListener('click',() => {
            exc.setSelect(5,4,6,8)
        })
        document.getElementById('btn6').addEventListener('click',() => {
            exc.clearTableDatasAndFormat()
        })
        exc.on("clickCell",(data) =>{
            console.log("点击了哦",data)
        })
        exc.on("moveCell",(data) =>{
            console.log("移动了哦",data)
        })
        exc.on("changeCell",(data) => {
          //  console.log("单元格改变了哦",data)
        })
    </script>
</body>
</html>